<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>图书信息列表</title>
</head>
<body>
<a href="/addBook">添加新书</a><hr/>
<table border="1">
    <tr>
        <th>编号</th>
        <th>书名</th>
        <th>价格</th>
        <th>类目</th>
        <th>库存</th>
        <th>图片</th>
        <th>说明</th>
        <th>作者</th>
        <th>已售</th>
    </tr>
    <tr th:each="b:${page.list}">
        <td th:text="${b.id}"></td>
        <td th:text="${b.name}"></td>
        <td th:text="${b.price}"></td>
        <td th:text="${b.category}"></td>
        <td th:text="${b.pnum}"></td>
        <td th:text="${b.imgurl}"></td>
        <td th:text="${b.description}"></td>
        <td th:text="${b.author}"></td>
        <td th:text="${b.sales}"></td>
    </tr>
</table>
<br/>
总页数：<span th:text="${page.pages}"></span>
总记录数：<span th:text="${page.total}"></span>
页面尺寸：<span th:text="${page.pageSize}"></span>
当前页记录数：<span th:text="${page.size}"></span>
<span th:if="${page.hasPreviousPage}">
    <a th:href="@{/booksPage(start=${page.pageNum-1})}">上一页</a>
</span>
&nbsp;
<span th:each="p:${#numbers.sequence(1,page.pages)}">
    <a  th:href="@{/booksPage(start=${p})}" th:text="${p}"></a>
</span>
<span th:if="${page.hasNextPage}">
    <a th:href="@{/booksPage(start=${page.pageNum+1})}">下一页</a>
</span>

</body>
</html>